<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
   xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
   xmlns:f="http://xmlns.jcp.org/jsf/core"
   xmlns:h="http://xmlns.jcp.org/jsf/html"
   xmlns:p="http://primefaces.org/ui"   
   xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
   template="/WEB-INF/templates/default.xhtml">
   
   	<f:metadata>	   	
	   	<f:viewParam name="firstResult" value="#{articleList.firstResult}"></f:viewParam>
	   	<f:viewParam name="categoryId" value="#{articleList.parameterValues['categoryId']}" ></f:viewParam>
	   	<f:viewParam name="moduleName" value="内容管理"></f:viewParam>
   	</f:metadata>
   
   	<ui:define name="content">
   
		<h:form id="searchForm">
			<p:panel id="searchResult" header="内容管理">
				<p:dataTable value="#{articleList.resultList}" var="_article">
					
					<p:column width="75%">
						<f:facet name="header">文章标题</f:facet>
						#{_article.title}
					</p:column>
					
					<ui:remove>
						<p:column>
							<f:facet name="header">审核时间</f:facet>
							<h:outputText value="#{_article.editDate}" >
								<f:convertDateTime pattern="yyyy:MM:dd HH:mm"/>
							</h:outputText>
						</p:column>
					</ui:remove>
					
					<p:column>
						<f:facet name="header">创建时间</f:facet>
						<h:outputText value="#{_article.createDate}" >
							<f:convertDateTime pattern="yyyy:MM:dd HH:mm"/>
						</h:outputText>
					</p:column>
					
					<p:column>
						<f:facet name="header">是否审核</f:facet>
						<h:outputText value="#{_article.stat eq '1' ? '已审核' : '未审核'}" >
							
						</h:outputText>
					</p:column>
					
					<p:column styleClass="actionColumn">
						<f:facet name="header">操作</f:facet>
						<p:button outcome="ArticleEdit.xhtml" value="编辑">
							<f:param name="articleId" value="#{_article.id}"></f:param>
							<f:param name="categoryId" value="#{param.categoryId}"></f:param>	    	
						</p:button>
						
					</p:column>
				</p:dataTable>
			</p:panel>
			
			<ui:include src="/WEB-INF/templates/manage/pagination.xhtml">
				<ui:param name="entityList" value="#{articleList}" />
			</ui:include>
			
		</h:form>
	    <p:button outcome="ArticleEdit.xhtml" value="添加" includeViewParams="true">
	    	<f:param name="categoryId" value="#{param.categoryId}"></f:param>	    	
	    </p:button>
   	</ui:define>
</ui:composition>
